The present invention relates to software programs that comprise software compliant, inter alia, with the Microsoft Component Object Model (COM) specification (and improved versions thereof, including but not limited to COM+), and in particular, to a system for minimizing modifications to modules in a software system when new functionality is added to the system, and for exchanging messages between software modules.
A software system is generally comprised of multiple modules which communicate among each other by passing messages. For a message to be passed, the programmer must designate a format for the message, and write software to allow: (a) the sending program to encode the message in that format; and (b) the receiving program to decode the message in that format. The xe2x80x9cencodingxe2x80x9d comprises, in essence, determining the number, data types and sequence of the parameters for the message.
It is often desirable to modify software to add new functionality. In many instances, the new functionality does not add any new data, but merely uses data that is defined elsewhere in the system. Often, this existing data exists in the messages that are passed among the pre-existing modules. Nevertheless, to add the new functionality, it is usually necessary to modify the pre-existing modules that reference the data upon which the new functionality is based, and add references to the newly written modules that implement the new functionality.
For example, consider a simple system comprising a control module and a reader module. The existing functionality of the control module is to send a xe2x80x9cread requestxe2x80x9d message to the reader module requesting the reader module to obtain a data reading from an attached (physical) reader, and the reader module sends a message back to the control module containing the reading. Suppose the system needs to be improved to add a module for logging every command or reading generated by each module of the system. In this example, the control and reader modules would both need to be modified so they by copy the command and reading data to a log file. For such a simple system, this may not require much work. However, most real systems would include hundreds of modules and objects, and each one would require modification. This would be a significant undertaking.
One object of the invention is to provide a software architecture that allows new functionality to be added to a pre-existing software system with few, if any, changes to the pre-existing software modules, by creating a new software module that merely accesses previously defined messages exchanged among the pre-existing software modules.
Another object of the invention is to provide a technique for encoding software messages according to a common format, so that any software module may receive a message sent by any other software module and extract from it the data it needs, regardless of how much other, unnecessary data may be included in the software message.
Another object of the invention is to provide a technique for changing the way messages are routed without changing software and without re-compiling.
Another object of the invention is to provide a technique for defining types of messages that are exchanged among software modules so that a programmer can specify characteristics of a message to be sent or received using a small number of lines of code.
Another object of the invention is to provide a software system in which software modules that send and receive messages according to a common format may use a single control for encoding and decoding messages in the common format, so that a programmer needs to write a small amount of code to send or receive messages in the common format.